home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_075
/
speeddir
/
poster
next >
Wrap
Text File
|
1992-05-06
|
5KB
|
139 lines
Article 4532 of comp.sys.amiga:
Path: mcdsun!noao!hao!ames!ucbcad!ucbvax!COGSCI.BERKELEY.EDU!bryce
From: bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt)
Newsgroups: comp.sys.amiga
Subject: Faster directories under AmigaDOS -> binary incl.
Message-ID: <8705110932.AA29181@cogsci.berkeley.edu>
Date: 11 May 87 09:32:57 GMT
Sender: usenet@ucbvax.BERKELEY.EDU
Lines: 157
This article describes a easy way to get faster directories under AmigaDOS.
The method described is:
1> 100% compatible.
2> Takes zero bytes of ram.
3> Works with existing disks -> no format changes.
4> Takes zero time to load.
All it requires is a tiny li
woah!!! EaThQuAke!!! (Good thing I don't live on landfill)
(Darn California earthquakes are always interrupting things)
(I would guess about 4.7 and from the south)
ttle change to the source code to AmigaDOS;
which sadly I do not have access to. :-(
The dos function that gets the next directory entry is Brain_Dead (like
most of the filesystem). It does many, many things as to guarantee that
it is slow! Two examples:
1> It reads entries in HASH order; as far as the disk is concered this
means RANDOM order. The dos could read one entry from Track 20 then
another from 21 and then end up back at 20 for the next.
2> It reads *all* the extension blocks of a file for the purpose of
counting the total blocks; since the filesystem will currently fill every
block full except the last, a DIVIDE will do the same at much less cost.
Here is a example snoop of a directory taken under the standard AmigaDOG
filesystem:
Block 880 -> Track 40 Head 0
Block 881 -> Track 40 Head 0
Block 882 -> Track 40 Head 0
Block 889 -> Track 40 Head 0
Block 891 -> Track 40 Head 1
Block 1011 -> Track 45 Head 1
Block 1013 -> Track 46 Head 0
Block 1039 -> Track 47 Head 0
Block 1041 -> Track 47 Head 0
Block 1082 -> Track 49 Head 0
Block 1089 -> Track 49 Head 1
Block 1180 -> Track 53 Head 1
Block 1183 -> Track 53 Head 1
Block 1184 -> Track 53 Head 1
Block 1186 -> Track 53 Head 1
Block 1199 -> Track 54 Head 1
Block 1186 -> Track 53 Head 1
Block 1200 -> Track 54 Head 1
Block 1202 -> Track 54 Head 1
Block 1273 -> Track 57 Head 1
Block 1296 -> Track 58 Head 1
Block 1299 -> Track 59 Head 0
Block 1301 -> Track 59 Head 0
Block 1303 -> Track 59 Head 0
Block 1305 -> Track 59 Head 0
Block 883 -> Track 40 Head 0
Block 1307 -> Track 59 Head 0
Block 1187 -> Track 53 Head 1
Notice how it goes from Track 53 to 54 to 53 to 54? That's 3 steps; a
*LONG* time. Now take a look at what the program presented here does;
Block 880 -> Track 40 Head 0
Block 881 -> Track 40 Head 0
Block 882 -> Track 40 Head 0
Block 883 -> Track 40 Head 0
Block 889 -> Track 40 Head 0
Block 891 -> Track 40 Head 1
Block 1011 -> Track 45 Head 1
Block 1013 -> Track 46 Head 0
Block 1039 -> Track 47 Head 0
Block 1041 -> Track 47 Head 0
Block 1082 -> Track 49 Head 0
Block 1089 -> Track 49 Head 1
Block 1180 -> Track 53 Head 1
Block 1183 -> Track 53 Head 1
Block 1184 -> Track 53 Head 1
Block 1186 -> Track 53 Head 1
Block 1187 -> Track 53 Head 1
Block 1200 -> Track 54 Head 1
Block 1202 -> Track 54 Head 1
Block 1273 -> Track 57 Head 1
Block 1296 -> Track 58 Head 1
Block 1299 -> Track 59 Head 0
Block 1301 -> Track 59 Head 0
Block 1303 -> Track 59 Head 0
Block 1305 -> Track 59 Head 0
Block 1307 -> Track 59 Head 0
It *SORTS* the blocks to reduce the number of needed seeks. It also
DIVIDES the number of bytes to get the number of blocks in the file.
(ie: It assumes each block is full -> a fair assumption considering the
current filesystem and the relative unimportance of the information)
It's not perfect; hash chains can force it to deviate, but it's better, and
if properly implemented, totaly transparant.
This program is not such a beast; it is a quick rehash of a program done
back when I tried to convince Commodore to place such a change in V1.2.
[Nothing happened]. It is not fully finished, I decided the old filesystem
is incurable; and must be 'burried deep'. Fortunatly it is very clean to
invent a *NEW* filesystem.
To start it "RUN SPEEDDIR" from a CLI. It will replace directory handlers
for drive DF1:. (Use a disk editor and change the string if you only
have a DF0:)
It works by patching the pr_PktWait field and handling packets of type
ExNext. For each packet it gets, it sets up a brand new message port,
,calls Trackdisk, then deallocates things. It will leave the drive
on after a read.
-> NOTE <- I do not know how to link into the buffers that AmigaDOS keeps;
this program is faster *WITHOUT* the use of cached blocks. If anyone
can help me on this point; PLEASE DO!
DISCLAIMER: This code is UNFINISHED, probably BUGGY, is UNCLEAN and is
intended for use by HACKERS ONLY. Commodore-Amiga/Metacomo you are welcome
to use these ideas for the next release -> but, better yet, write a *real*
filesystem.
-Bryce Nesbitt- // Dedicated to eradicating all traces of
\\// this latest world-wide outbreak of BCPL.
bryce@cogsci.berkeley.edu